package ch.selise.archtool.lib.builders;

import ch.selise.archtool.lib.HouseBuilder;
import ch.selise.archtool.lib.product.House;
import ch.selise.archtool.lib.product.houseunit.Basement;
import ch.selise.archtool.lib.product.houseunit.Floor;
import ch.selise.archtool.lib.product.houseunit.Roof;
import ch.selise.archtool.lib.product.houseunit.Wall;

public class MultiStoryHouseBuilder implements HouseBuilder{

	private House house;
	private int floorNumber;
	
	public MultiStoryHouseBuilder(int floor){
		this.house = new House();
		this.floorNumber = floor;
	}
	@Override
	public void buildBasement() {
			this.house.setBasement(new Basement());		
	}
	
	@Override
	public void buildFloors() {
		for (int i = 1; i <= floorNumber; i++) {
			this.house.addFloor(new Floor(i));
		}
	}
	
	@Override
	public void buildWalls() {
		for (int i = 1; i <= floorNumber; i++) {
			for (int j = 0; j < 4; j++)
				this.house.addWall(new Wall());
		}
		
	}
	@Override
	public void buildRoof() {
		this.house.setRoof(new Roof());
		
	}
	@Override
	public House getHouse() {
		return this.house;
	}
}
